<!Doctype html>
<html xmlns=http://www.w3.org/1999/xhtml> <head>
<meta http-equiv=Content-Type content="text/html;charset=utf-8">
<meta http-equiv=X-UA-Compatible content="IE=edge,chrome=1">
<meta content=always name=referrer>
<link rel="shortcut icon" href=/favicon.ico type=image/x-icon> <title>H.265在线播放器DEMO</title>
<link rel="stylesheet" href="../dist/goldplay-h265.css">
<script src="../dist/goldplay-h265-sdk.js"></script>
<style>
  .play-container {
    width: 800px;
    height: 600px;
    /* background-color: #000; */
    margin: 20px 0 0 100px;
    float:left;
  }

  .inline {
    display: inline-block;
    width: 50px;
  }
  .play-container2 {
    width: 300px;
    height: 400px;
    background-color: red;
    margin: 20px 0 0 100px;
    float:left;
  }
</style>
</head>

<body>
  <div id="PlayerWrapper">
    <h3>H.265 Player <b>Demo2 同时两个播放器实例</b>
    <em class="demo1" id="Demo1">DEMO</em>
    </h3>
    <div class="play-container"></div>
    <div class="play-container2"></div>
  </div>
  <br clear="all">
  <br>
  <script>
    (function (win, doc) {
      const Config = {
        get basePath() {
          let path = win.location.origin
          let pathname = win.location.pathname
          let demoIdx = pathname.lastIndexOf('/demo/')
          return path + pathname.substr(0, demoIdx)
        },
        get buildPath() {
          return this.basePath + '/dist/'
        },
        get libPath() {
          return this.buildPath + 'lib/'
        },
        get src() {
          return this.basePath + '/data/video1/playlist.m3u8'
        },
        get src2() {
          return this.basePath + '/data/video2/playlist.m3u8'
        }
      }

      // demo1
      let el = doc.querySelector('.play-container')
      let player = new GoldPlay(el, {
        sourceURL: Config.src,
        type: 'HLS',
        libPath: Config.libPath,
        playBackRate: 1,
        controlBarAutoHide: true
      })

      // demo2
      let el2 = doc.querySelector('.play-container2')
      let player2 = new GoldPlay(el2, {
        sourceURL: Config.src2,
        type: 'HLS',
        libPath: Config.libPath,
        playBackRate: 1,
      })

    })(window, document)
  </script>
</body>

</html>
